const _sampleDeepClone = (target) => {
  if (typeof target !== "object" || target === null) return target;

  const copy = Array.isArray(target) ? [] : {};
  // for in 会遍历对象及其原型链上所有可枚举属性，使用obj.hasOwnProperty(key)过滤
  for (const key in target) {
    if (target.hasOwnProperty(key))
      copy[key] =
        typeof target[key] === "object"
          ? _sampleDeepClone(target[key])
          : target[key];
  }

  return copy;
};
